package org.jeecg.modules.demo.utils;

import org.apache.shiro.SecurityUtils;
import org.jeecg.common.api.dto.message.BusMessageDTO;
import org.jeecg.common.api.dto.message.MessageDTO;
import org.jeecg.common.constant.CommonConstant;
import org.jeecg.common.system.vo.LoginUser;
import org.jeecg.common.util.SysAnnmentTypeEnum;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

public class MsgUtils {

//    @Autowired
//    private ISysBaseAPI sysBaseAPI;
//    public  void sendMesage( String toUser , String title, String msgContent ,  String busId ){
//        LoginUser sysUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
//
//        //发送人
//        String fromUser =  sysUser.getUsername();
//
//        //发送系统消息
//        sysBaseAPI.sendSysAnnouncement(new MessageDTO(fromUser, toUser, title, msgContent));
//
//        //消息类型
//        String msgCategory = CommonConstant.MSG_CATEGORY_1; //系统消息
//
//        //业务类型
//        String busType = SysAnnmentTypeEnum.EMAIL.getType();
//
//        //发送带业务参数的系统消息
//        BusMessageDTO busMessageDTO = new BusMessageDTO(fromUser, toUser, title, msgContent, msgCategory, busType,busId);
//        sysBaseAPI.sendBusAnnouncement(busMessageDTO);
//
//    }
}
